mat2img
I = mat2img(mat::Array{<:Unsigned}; x=[], y=[], hdr=nothing, proj4="", wkt="", cmap=nothing, kw...)Take a 2D mat array and a hdr 1x9 [xmin xmax ymin ymax zmin zmax reg xinc yinc] header descriptor and return a GMTimage type. Alternatively to hdr, provide a pair of vectors, x & y, with the X and Y coordinates. Optionally, the hdr arg may be omitted and it will computed from mat alone, but then x=1:ncol, y=1:nrow When mat is a 3D UInt16 array we automatically compute a UInt8 RGB image. In that case cmap is ignored. But if no conversion is wanted use option noconv=true
The method
I = mat2img(mat::Array{UInt16}; x=[], y=[], hdr=nothing, proj4::String="", wkt::String="", kw...)Take a mat array of UInt16 and scale it down to UInt8. Input can be 2D or 3D. If the kw variable stretch is used, we stretch the intervals in stretch to [0 255]. Use this option to stretch the image histogram. If stretch is a scalar, scale the values > stretch to [0 255] - stretch = [v1 v2] scales all values >= v1 && <= v2 to [0 255] - stretch = [v1 v2 v3 v4 v5 v6] scales first band >= v1 && <= v2 to [0 255], second >= v3 && <= v4, same for third - stretch = :auto | "auto" | true | 1 will do an automatic stretching from values obtained from histogram thresholds
The kw... kwargs search for [:layout :mem_layout], [:names] and [:metadata]
See Also
Source Code
This function has multiple methods:
mat2img(mat, G::GMTgrid; names, metadata)- utils_types.jl:1543mat2img(mat, I::GMTimage; names, metadata)- utils_types.jl:1539mat2img(mat::Union{GMTgrid, Matrix{<:AbstractFloat}}; x, y, hdr, proj4, wkt, GI, clim, cmap, kw...)- utils_types.jl:1454mat2img(img::GMTimage; kw...)- utils_types.jl:1440mat2img(mat::Union{AbstractArray{UInt16, 3}, AbstractMatrix{UInt16}}; x, y, v, hdr, proj4, wkt, img8, kw...)- utils_types.jl:1373mat2img(mat::Union{AbstractArray{<:Unsigned}, AbstractArray{<:Bool}}; x, y, v, hdr, proj4, wkt, cmap, is_transposed, kw...)- utils_types.jl:1272